#pragma once


// CDlgProjSettingsHoopFormula dialog

class CDlgProjSettingsHoopFormula : public CDialog
{
	DECLARE_DYNAMIC(CDlgProjSettingsHoopFormula)

private:

	CString m_strOldVal ;
	BOOL	m_bCancelSel;
	BOOL	ReadItem(CString strLimbName);
	int 	ReadDefault(CString strLimbName);
	int		GetModifyFormulaCount();
	void	InitCancelInfo(CANCEL_INFO* pNode,int nOpType,LPCTSTR szHint,char* szOldItem,char* szNewItem);
	int		CheckMyExpress(long Row,long Col,CString strVal,CString &strErrMsg,char *szOut);
	void	UpdateRecord(long Row, long Col, char* szValue);
	CRect   m_RtBmp ;
	HBITMAP m_hBitmap		;
	void 	BufferToHBITMAP(HDC hDC, char*pBMPBuffer);
	void	ShowBmp(char *szFile);
	void	ShowEmptyBmp();
public:
	BOOL	Read();
	void	Clear();
	void	Cancel(CANCEL_INFO* pNode);
	void	Redo(CANCEL_INFO* pNode);
	bool	m_bChangeAdjust1 ;
	bool	m_bChangeAdjust2 ;
	bool	CheckAdjustFormula(CString strAdjust,char* szOutVal);
public:
	CDlgProjSettingsHoopFormula(CWnd* pParent = NULL);   // standard constructor
	virtual ~CDlgProjSettingsHoopFormula();
	virtual BOOL OnInitDialog() ;
	virtual BOOL PreTranslateMessage(MSG* pMsg);

// Dialog Data
	enum { IDD = IDD_Dlg_Proj_Settings_HoopFormula };
	CVSFlexGrid	m_Vs;

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

	DECLARE_EVENTSINK_MAP()
	afx_msg void OnClickVs();
	afx_msg void BeforeEditVs(long Row, long Col, BOOL FAR* Cancel);
	afx_msg void OnBeforeSelChangeVs(long OldRowSel, long OldColSel, long NewRowSel, long NewColSel, BOOL FAR* Cancel);
	afx_msg void OnAfterSelChangeVs(long OldRowSel, long OldColSel, long NewRowSel, long NewColSel);
	afx_msg void OnCellChangedVs(long Row, long Col);

	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnDestroy();
	afx_msg void OnPaint();
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnBnClickedButtonResume();
	afx_msg void OnBnClickedButtonImport();
	afx_msg void OnBnClickedButtonExport();
	afx_msg void OnEnKillfocusEditAdjust1();
	afx_msg void OnEnKillfocusEditAdjust2();
	afx_msg void OnEnChangeEditAdjust1();
	afx_msg void OnEnChangeEditAdjust2();
	afx_msg void OnCbnSelendokComboLimb(); 
};
